<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
 Route::prefix('v1')->group(function () {

     Route::post('/login', 'LoginController@loginByPhone');
     Route::get('/login', 'LoginController@login')->name('login');
     Route::post('/wx-login', 'LoginController@wxLogin');
     Route::post('/bind', 'LoginController@bind');
     Route::post('/files', 'FileController@upload');
     Route::get('/word/{id}', 'WordController@show');

     Route::middleware('auth:api')->group(function () {
         Route::resource('/users', 'UserController');
         Route::post('/password', 'LoginController@password');
         Route::resource('/categories', 'CategoryController');
         Route::resource('/contents', 'ContentController');
         Route::get('/wx-categories', 'CategoryController@withContent');
         Route::resource('/lists', 'OrderController');
     });
 });
